<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class DownloadCount extends Model
{
    protected $fillable = [
        'ip','source_id'
    ];

    public function setIpAttribute($value)
    {
        $this->attributes['ip'] = ip2long($value);
    }

    public function getIpAttribute($value)
    {
        return long2ip($value);
    }
}
